home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6405 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.8 KB  |  62 lines

  1. Path: news1.h1.usa.pipeline.com!usenet
  2. From: grantp@usa.pipeline.com(Pete)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: HELP: Strange DLL linker warning!
  5. Date: 7 Feb 1996 23:46:58 GMT
  6. Organization: Kalevi, Inc.
  7. Message-ID: <4fbdli$7cr@news1.usa.pipeline.com>
  8. References: <4f8ljg$ffl@sam.inforamp.net>
  9. NNTP-Posting-Host: pipe2.h1.usa.pipeline.com
  10. X-PipeUser: grantp
  11. X-PipeHub: usa.pipeline.com
  12. X-PipeGCOS: (Pete)
  13. X-Newsreader: Pipeline USA v3.3.0
  14.  
  15. On Feb 06, 1996 22:49:17 in article <Re: HELP: Strange DLL linker
  16. warning!>, 'rmorin@inforamp.net (Randy Charles Morin)' wrote: 
  17.  
  18.  
  19. >In article <4f7v88$k40@scotsman.ed.ac.uk>, 
  20. >Steven <steven@srv1.jig.ed.ac.uk> wrote: 
  21. >>hi, 
  22. >> 
  23. >>I have a DLL and I want to export the functions within it. So in the DLL 
  24.  
  25. >definition  
  26. >>file (*.def) at the EXPORT section I have entered the names of the
  27. functions  
  28. >I want  
  29. >>to export. But low and behold I get the following warning: 
  30. >> 
  31. >>Linker Warning: Attempt to export non-public symbol 'function name' 
  32. >> 
  33. >>Why? I don't know how to declare these functions as public and I have  
  34. >explicitly  
  35. >>defined them as _export . Can anyone help. By the way I'm using the 3.1  
  36. >compiler. 
  37. >>Cheers! 
  38. >> 
  39. >>Steve  
  40. >> 
  41. >Switches, switches switches.  Either, you need to change the case
  42. sensitive  
  43. >link switches or the export function from DLL switches.  I could be wrong 
  44.  
  45. >though. 
  46. A more common error:  failing to wrap the exported c++ function 
  47. declaration with extern "C" and _pascal.  Example: 
  48.  
  49. extern "C" int CALLBACK _export  Foo (int Bar) { ... }; 
  50.  
  51. The macro CALLBACK is defined in <windows.h> as _far _pascal, 
  52. or whatever is appropriate with your compiler system.  This may 
  53. not be so with older systems; if not, substitute the keywords 
  54. yourself. 
  55.  
  56. -- 
  57. Pete Grant 
  58. Kalevi, Inc. 
  59. Object Oriented Software Development
  60.